import request from '@/utils/request'

export function addOrder(courseId, type) {
    return request({
        url: `/order/order/addOrder/${courseId}/${type}`,
        method: 'put',
    })
}

export function addOrderByClassId(classId, type) {
    return request({
        url: `/order/order/addOrderByClassId/${classId}/${type}`,
        method: 'put',
    })
}

export function getOrderByOrderNo(orderNo) {
    return request({
        url: `/order/order/getOrderByOrderNo/${orderNo}`,
        method: 'get',
    })
}

export function getOrderStatus(orderNo) {
    return request({
        url: `/order/order/getOrderStatus/${orderNo}`,
        method: 'get',
    })
}

export function getAllOrdersOfUser() {
    return request({
        url: `/order/order/getAllOrdersOfUser/`,
        method: 'get',
    })
}

export function ifOrderPayAndDelete(courseId) {
    return request({
        url: `/order/order/ifOrderPayAndDelete/${courseId}`,
        method: 'post',
    })
}